package com.zhenxiang.juc.list.unsafe;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Author : James
 * @Create : 2021-12-21-16:55
 * @Description :
 */
public class MapTest {

    public static void main(String[] args) {

        Map<Object, Object> map = new ConcurrentHashMap<>();

        for (int i = 0; i < 10; i++) {
            new Thread(()->{
                map.put(UUID.randomUUID().toString().substring(0,5),Thread.currentThread().getName());
                System.out.println(map);
            },String.valueOf(i)).start();

        }

    }

}
